package factory;

import lombok.extern.slf4j.Slf4j;

/**
 * @author zenghy
 **/
@Slf4j
public class ShapeFactory {

    public static Shape shape(Shape.Type type) {
        switch (type) {
            case Circle:
                return new CircleShape();
            case Square:
                return new SquareShape();
            case Rectangle:
                return new RectangleShape();
            default:
                throw new UnsupportedOperationException();
        }
    }
}
